﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HeartLess.Activities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace HeartLess.Managers
{
    public static class ActivityManager
    {
        private static bool _outOfDate;

        private static Activity _currentActivity;
        public static Activity CurrentActivity
        {
            get { return _currentActivity; }
            set
            {
                _currentActivity = value;
                _outOfDate = true;
            }
        }

        public static void Update(GameTime gameTime)
        {
            do
            {
                _outOfDate = false;
                CurrentActivity.Update(gameTime);

            } while (_outOfDate);
        }

        public static void Draw(SpriteBatch spriteBatch)
        {
            CurrentActivity.Draw(spriteBatch);
        }

    }
}
